import { baseApiUrl, path } from "../../utils/config";
import { courseClassUnify } from '../../utils/api';
const app = getApp();
Page({
  data: {
    baseImageUrl: baseApiUrl,
    list: []
  },
  onLoad(options) {
    this.getList();
  },
  onReachBottom() {
    let page = this.data.page;
    let last_page = this.data.last_page;
    if (page == last_page) return false;
    page += 1;
    this.setData({ page });
    this.getList();
  },
  async getList() {
    let { data } = await courseClassUnify();
    this.setData({ list: data });
  },
  router(e) {
    let { url } = e.currentTarget.dataset;
    wx.navigateTo({ url });
  },
  onShareAppMessage() {
    let poster = app.globalData.poster;
    return {
      path,
      imageUrl: poster
    }
  },
  onShareTimeline() { }
});